;(function() {
		init_parsley();
		$("#get_contract").click(function(){
			$card_no=$("#card_no").val();
			$shop_id=$("#shop_id").val();
			$api_version=$("#api_version").val();
			$mobile=$("#mobile").val();
			if($card_no.length<3){
				toastr['error']("卡号长度必须大于3");
				return false;
			}
			loading();
			$.post(
				"/Admin/Shop/getcontract",
				{"card_no":$card_no,"shop_id":$shop_id,"api_version":$api_version,"mobile":$mobile},
				function(data){
					close_loading();
					if(data.flag){
						$("#result").text(data.data);
					}else{
						$("#result").text(data.msg);
					}
				}
			);
			return false;
		});
		$("#check_in").click(function(){
			$card_no=$("#card_no").val();
			$shop_id=$("#shop_id").val();
			$api_version=$("#api_version").val();
			$mobile=$("#mobile").val();
			if($card_no.length<3){
				toastr['error']("卡号长度必须大于3");
				return false;
			}
			loading();
			$.post(
				"/Admin/Shop/check_in",
				{"card_no":$card_no,"shop_id":$shop_id,"api_version":$api_version,"mobile":$mobile},
				function(data){
					close_loading();
					if(data.flag){
						$("#result").text(data.data);
					}else{
						$("#result").text(data.msg);
					}
				}
			);
			return false;
		})
		$("#get_list").click(function(){
			$card_no=$("#card_no").val();
			$shop_id=$("#shop_id").val();
			$api_version=$("#api_version").val();
			$mobile=$("#mobile").val();
			if($card_no.length<3){
				toastr['error']("卡号长度必须大于3");
				return false;
			}
			loading();
			$.post(
				"/Admin/Shop/getptlist",
				{"card_no":$card_no,"shop_id":$shop_id,"api_version":$api_version,"mobile":$mobile},
				function(data){
					close_loading();
					if(data.flag){
						$("#result").text(data.data);
					}else{
						$("#result").text(data.msg);
					}
				}
			);
			return false;
		})
})();